<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 150px;
            margin: auto;
            border: 1px solid;
        }

        nav {
            width: 200px;
            border: 1px solid;
            background-color: red;
            color: white;
            margin: auto;
            border: 2px solid black;
            margin-top: 2px;
            display: none;
        }
    </style>
</head>

<body>
    <div><input type="checkbox">两周内自动登录</div>
    <nav>
        <p>为了您的信息安全，请不要在网吧或公用电脑上使用此功能</p>
    </nav>
</body>

</html>
<script>
    let div = document.querySelector('div')
    let nav = document.querySelector("nav")
    div.onmouseover = function () {
        nav.style.display = 'block'
    }
    div.onmouseout = function () {
        nav.style.display = 'none'
    }
</script>